﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kokomo.Mirror.PeFormat.Resources
{
	public class ResourcePath
	{
		public ResourcePath(params ResourcePathPart[] parts)
		{
			if (parts == null) throw new ArgumentNullException("parts");

			this.Parts = parts;
		}

		public override string ToString()
		{
			string text = string.Join("\\", (IEnumerable<ResourcePathPart>)this.Parts);
			return text;
		}

		public ResourcePathPart[] Parts { get; private set; }

		public ResourcePath Concat(ResourcePathPart part)
		{
			if (part == null) throw new ArgumentNullException("part");

			ResourcePathPart[] parts = new ResourcePathPart[this.Parts.Length + 1];
			Array.Copy(this.Parts, 0, parts, 0, this.Parts.Length);
			parts[this.Parts.Length] = part;

			return new ResourcePath(parts);
		}
	}
}
